#include <gtest/gtest.h>
#include <pybind11/embed.h>

namespace {
// Setup and teardown the python interpreter.
struct PythonEnv : ::testing::Environment {
  std::unique_ptr<pybind11::scoped_interpreter> scope;
  ~PythonEnv() override {}
  void SetUp() override { scope.reset(new pybind11::scoped_interpreter); }
  void TearDown() override { scope.reset(); }
};

::testing::Environment* const python_interp_env =
    ::testing::AddGlobalTestEnvironment(new PythonEnv);
}  // namespace
